package net.hzlj.platform.enterprise.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import net.hzlj.platform.enterprise.common.Constant;
import net.hzlj.platform.enterprise.service.InitService;

/**
 * @Description: 初始化数据
 * @Author: Jason.Zhang zhangyujn1989ok@gmail.com
 * @Date: 2016年8月24日16:55:20
 */
public class InitReceiver extends BroadcastReceiver {

    private static final String TAG = InitReceiver.class.getSimpleName();

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.i(TAG, action);
        Intent i = new Intent(context, InitService.class);
        if (Constant.Intent.ACTION_UPLOAD_FACE_PHOTO.equals(action)) {
            i.putExtra("id", intent.getLongExtra("id", 0L));
        } else if (Constant.Intent.ACTION_APP_INIT.equals(action)) {
            i.putExtra("is_account_login", intent.getBooleanExtra("is_account_login", false));
        } else if (Constant.Intent.ACTION_LOCATION_UPDATE.equals(action)) {
            //
        }
//        else if (Constant.Intent.ACTION_BAIDU_LBS.equals(action)){
//            LocationBean bean = (LocationBean) intent.getSerializableExtra("lbs_Location");
//            i.putExtra("lbs_Location", bean);
//        }
//        else if (Constant.Intent.ACTION_CAMERA_CAPTRUE.equals(action)){
//            i = new Intent(context, TakePictureService.class);
//        }
        i.setAction(action);
        context.startService(i);
    }
}
